package com.wm.web.controller.system;


import com.wm.common.core.controller.BaseController;
import com.wm.common.core.domain.AjaxResult;
import com.wm.common.core.page.TableDataInfo;
import com.wm.system.domain.Valuation;
import com.wm.system.service.IValuationService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 * 卖车估值表 前端控制器
 * </p>
 *
 * @author hyq
 * @since 2023-10-10 22:06:26
 */
@RestController
@RequestMapping("/system/valuation")
public class ValuationController extends BaseController {

    @Autowired
    private IValuationService service;

    @ApiOperation("卖车估值分页查询")
    @GetMapping("list")
    public TableDataInfo list(Valuation valuation){
        startPage();
        List<Valuation> valuations = service.selectValuationList(valuation);
        return getDataTable(valuations);
    }

    @ApiOperation("卖车估值新增和修改")
    @PostMapping("addOrUpdate")
    public AjaxResult addOrUpdate(@RequestBody Valuation valuation){
        service.addOrUpdate(valuation);
        return AjaxResult.success();
    }
}
